package com.hzeport.bgs22emduty.outbound.db;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hzeport.bgs22emduty.dto.ScreenMessageReadDTO;
import com.hzeport.bgs22emduty.entity.ScreenMessage;
import com.hzeport.bgs22emduty.outbound.ScreenMessageRepository;
import com.hzeport.bgs22emduty.outbound.db.mapper.ScreenMessageMapper;
import com.masa.common.core.base.BaseResult;
import com.masa.common.data.base.BaseRepositoryImpl;
import org.springframework.stereotype.Service;

@Service
public class ScreenMessageRepositoryImpl extends BaseRepositoryImpl<ScreenMessageMapper, ScreenMessage> implements ScreenMessageRepository {


    @Override
    public BaseResult savels(ScreenMessageReadDTO screenDutyMessageSaveVO) {
        ScreenMessage screenMessage=new ScreenMessage();
        screenMessage.setHasReaded("1");
        screenMessage.setReadBy(screenDutyMessageSaveVO.getReadBy());
        this.update(screenMessage,new LambdaQueryWrapper<ScreenMessage>()
        .in(ScreenMessage::getId,screenDutyMessageSaveVO.getIds()));
        return BaseResult.ok("保存成功");
    }
}
